<%@page import="com.zqc.UserMassage" %>
<%@page import="com.zqc.leimu" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<link href="css/style.css" rel="stylesheet">
<link href="css/pushy-buttons.css" rel = "stylesheet">
<link href="css/cloud_bg.css" rel="stylesheet">
<link href="css/hover_button.css" rel="stylesheet">
<head>
    <%@ include file="lianjie.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>图书</title>
</head>
<body>
<div id="clouds" style="background-color: lightskyblue">
<form name="fm">
    <table align="center">

        <tr style="font-size:50px;">
            <td>用户信息</td>
        </tr>
    </table>

    <table border="0" cellspacing="0" cellpadding="1" align="center">
        <%
            request.setCharacterEncoding("UTF-8");
            Object name = session.getAttribute("se_Name");
            Object sex = session.getAttribute("se_Sex");
            Object dlm = session.getAttribute("se_Dlm");
            Object tel = session.getAttribute("se_Tel");
        %>

        <tr>
            <td width="40">姓名:</td>
            <td width="60"><input type="text" value="<%=name %>" disabled></td>

        </tr>

        <tr>
            <td>学号:</td>
            <td><input type="text" value="<%=dlm%>" disabled></td>
        </tr>
        <tr>
            <td>电话:</td>
            <td><input type="text" value="<%=tel%>" disabled></td>
        </tr>
        <tr>
            <td>性别:</td>
            <td><input type="text" value="<%=sex%>" disabled></td>
        </tr>
    </table>

    <div class="cloud x2"></div>
    <hr/>
    <table align="center">

        <tr style="font-size:50px;">
            <td>借书情况</td>
        </tr>
    </table>

    <table width="70%" border="1" cellspacing="0" cellpadding="3" align="center">
        <tr>
            <th width="20%">borrow_userID</th>
            <th width="20%">borrow_bookISBN</th>
            <th width="20%">borrow_date</th>
            <th width="20%">borrow_bookname</th>
        </tr>
        <%
            String borrow_userID = ""; //
            String borrow_bookISBN = ""; //
            String borrow_date = ""; //
            String borrow_bookname = ""; //

            String sql = "select * from borrowinformation where userID = '" + dlm + "'";
            ResultSet rs1 = stmt.executeQuery(sql);

            while (rs1.next()) {
                borrow_userID = rs1.getString("userID");
                borrow_bookISBN = rs1.getString("bookISBN");
                borrow_date = rs1.getString("date");
                borrow_bookname = rs1.getString("bookname");
        %>

        <tr align="center">
            <%-- <td><input type="checkbox" name="selectUser"
                value="<%=borrow_userID%>"><%=borrow_userID%></td> --%>
            <td><%=borrow_userID%>
            </td>
            <td><%=borrow_bookISBN%>
            </td>
            <td><%=borrow_date%>
            </td>
            <td><%=borrow_bookname%>
            </td>
        </tr>
        <%
            }
            session.setAttribute("userID", borrow_userID);
        %>

    </table>

    <br>

    <div class="cloud x1"></div>
    <hr/>
    <table align="center">
        <div style="font-size:50px;color:blue;" align="center">
            图书借阅

        </div>
        <tr>
            <td>
                <a class="button" href="borrow_jisuanji.jsp">计算机类</a>
            </td>
        </tr>

        <tr>
            <td>
                <a class="button" href="borrow_shengmingkexue.jsp">生命科学类</a>
            </td>
        </tr>

        <tr>
            <td>
                <a class="button" href="borrow_yixue.jsp">医学类</a>
            </td>
        </tr>

        <tr>
            <td>
                <a class="button" href="borrow_xiaoshuo.jsp">小说类</a>
            </td>
        </tr>

    </table>
    <br><br><br>
    <div align="center">
        <input type="submit" name="submit1" value="退出登录" class = "btn btn--md btn--blue" href = "#" onclick="return_login()"
               style="font-size:20px;font-family:'微软雅黑';color: black;">
    </div>


</form>
</div>
</body>
<script>
    function return_login() {
        document.fm.action = "aa_login.jsp";
    }
</script>
</html>